dojo.declare("DVendorOrderCurrentPg", wm.Page, {
start: function() {
//this.svVendorCurrentOrders.update();
},
"preferredDevice": "desktop",
svUpdateOrderStatusSuccess1: function(inSender, inDeprecated) {
this.svVendorCurrentOrders.clearData()
this.lvOrderItems.clearData();
this.svVendorCurrentOrders.update();
},
listVendorOrdersOrderIdFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
//order id
var comment = '';
if (rowObj.comment != null) comment = rowObj.comment;
var display = "<div class='MobileRowTitle'><b>Order#:</b> " + rowObj.orderId + "</div>" + "<div class='MobileRow'>" + wm.List.prototype.dateFormatter({
"formatLength": "medium",
"dateType": "date and time"
}, null, null, null, rowObj.orderDt) + "</div>" + "<div class='MobileRow'>Comments: " + comment + "</div>";
return display;
},
listVendorOrdersCustomerNameFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
var display = "<div class='MobileRow'><b>Customer Details: </b> </br>" + rowObj.customerName + "</br> Ph: " + rowObj.contactNum + "</br> Address : Block - " + rowObj.blockName + "</br> Door -" + rowObj.doorName + "</div>";
return display;
},
listVendorOrdersStatusFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
var display = "<div class='MobileRowTitle'><b>Status :</b> </br> " + rowObj.status + "</div>";
return display;
},
listVendorOrdersPriceFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
var display = "<div class='MobileRow'><b>TotalPrice: <b>" + rowObj.price + "</div>";
return display;
},
list2OrderItemIdFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
var comment = '';
if (rowObj.comments != null) {
comment = rowObj.comments;
}
var display = "<div class='MobileRow'>Item Name: " + rowObj.items.itemName + "</div>" + "<div class='MobileRow'>Item Desc: " + rowObj.items.itemDesc + "</div>" + "<div class='MobileRowTitle'>Quantity: " + rowObj.quantity + "</div>" + "<div class='MobileRow'>Price: " + rowObj.price + "</div>" + "<div class='MobileRow'>Comments: " + comment + "</div>";
return display;
},
listVendorOrdersSelect1: function(inSender, inItem) {
this.selectMenu1.setDataValue("Delivered");
},
button2Click1: function(inSender) {
this.svVendorCurrentOrders.clearData();
},
_end: 0
});

DVendorOrderCurrentPg.widgets = {
lvOrderItems: ["wm.LiveVariable", {"autoUpdate":false,"inFlightBehavior":"executeLast","startUpdate":false,"type":"com.servicelivedb.data.OrderItems"}, {}, {
liveView: ["wm.LiveView", {"dataType":"com.servicelivedb.data.OrderItems","related":["items"],"view":[{"caption":"OrderItemId","sortable":true,"dataIndex":"orderItemId","type":"java.lang.Integer","displayType":"Number","required":true,"readonly":true,"includeLists":true,"includeForms":true,"order":1000,"subType":null,"widthUnits":"px"},{"caption":"Quantity","sortable":true,"dataIndex":"quantity","type":"java.lang.Short","displayType":"Number","required":false,"readonly":false,"includeLists":true,"includeForms":true,"order":1001,"subType":null,"widthUnits":"px"},{"caption":"Price","sortable":true,"dataIndex":"price","type":"java.math.BigDecimal","displayType":"Number","required":false,"readonly":false,"includeLists":true,"includeForms":true,"order":1002,"subType":null,"widthUnits":"px"},{"caption":"Comments","sortable":true,"dataIndex":"comments","type":"java.lang.String","displayType":"Text","required":false,"readonly":false,"includeLists":true,"includeForms":true,"order":1003,"subType":null,"widthUnits":"px"},{"caption":"ItemId","sortable":true,"dataIndex":"items.itemId","type":"java.lang.Integer","displayType":"Number","required":true,"widthUnits":"px","includeLists":true,"includeForms":true,"order":2000},{"caption":"ItemName","sortable":true,"dataIndex":"items.itemName","type":"java.lang.String","displayType":"Text","required":false,"widthUnits":"px","includeLists":true,"includeForms":true,"order":2001},{"caption":"ItemDesc","sortable":true,"dataIndex":"items.itemDesc","type":"java.lang.String","displayType":"Text","required":false,"widthUnits":"px","includeLists":true,"includeForms":true,"order":2002}]}, {}],
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"listVendorOrders.selectedItem.orderId","targetProperty":"filter.order.orderId"}, {}]
}]
}],
ncOrderStatusUpdate: ["wm.NotificationCall", {"operation":"toast"}, {}, {
input: ["wm.ServiceInput", {"type":"toastInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":"\"Order status updated successfully\"","targetProperty":"text"}, {}],
wire1: ["wm.Wire", {"expression":"2000","targetProperty":"duration"}, {}],
wire2: ["wm.Wire", {"expression":"\"Success\"","targetProperty":"cssClasses"}, {}],
wire3: ["wm.Wire", {"expression":"\"bottom center\"","targetProperty":"dialogPosition"}, {}]
}]
}]
}],
svUpdateOrderStatus: ["wm.ServiceVariable", {"inFlightBehavior":"executeLast","operation":"updateOrderStatus","service":"serviceliveDB"}, {"onError":"ncSuccessOrderUpdateFail","onSuccess":"ncSuccessOrderUpdate","onSuccess1":"svUpdateOrderStatusSuccess1"}, {
input: ["wm.ServiceInput", {"type":"updateOrderStatusInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"selectMenu1.selectedItem.dataValue","targetProperty":"status"}, {}],
wire1: ["wm.Wire", {"expression":undefined,"source":"listVendorOrders.selectedItem.orderId","targetProperty":"orderId"}, {}]
}]
}]
}],
ncSuccessOrderUpdate: ["wm.NotificationCall", {"operation":"toast"}, {}, {
input: ["wm.ServiceInput", {"type":"toastInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":"\"Order Updated Successfully\"","targetProperty":"text"}, {}],
wire1: ["wm.Wire", {"expression":"3000","targetProperty":"duration"}, {}],
wire2: ["wm.Wire", {"expression":"\"Success\"","targetProperty":"cssClasses"}, {}],
wire3: ["wm.Wire", {"expression":"\"bottom center\"","targetProperty":"dialogPosition"}, {}]
}]
}]
}],
ncSuccessOrderUpdateFail: ["wm.NotificationCall", {"operation":"toast"}, {}, {
input: ["wm.ServiceInput", {"type":"toastInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire1: ["wm.Wire", {"expression":"3000","targetProperty":"duration"}, {}],
wire: ["wm.Wire", {"expression":"\"Error During Order Update\"","targetProperty":"text"}, {}],
wire2: ["wm.Wire", {"expression":"\"Error\"","targetProperty":"cssClasses"}, {}],
wire3: ["wm.Wire", {"expression":"\"bottom center\"","targetProperty":"dialogPosition"}, {}]
}]
}]
}],
vCurrentDate: ["wm.Variable", {"type":"DateData"}, {}],
svVendorCurrentOrders: ["wm.ServiceVariable", {"autoUpdate":true,"inFlightBehavior":"executeLast","operation":"getTodaysVendorOrders","service":"serviceliveDB","startUpdate":true}, {}, {
input: ["wm.ServiceInput", {"type":"getTodaysVendorOrdersInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"[main].lvLoggedCustomer.customerId","targetProperty":"vendorId"}, {}]
}]
}]
}],
ldOrders: ["wm.LoadingDialog", {"caption":"Loading Orders.."}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"panel4","targetProperty":"widgetToCover"}, {}],
wire1: ["wm.Wire", {"expression":undefined,"source":"svVendorCurrentOrders","targetProperty":"serviceVariableToTrack"}, {}]
}]
}],
ldOrdersItems: ["wm.LoadingDialog", {"caption":"Loading Order Details.."}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"panel5","targetProperty":"widgetToCover"}, {}],
wire1: ["wm.Wire", {"expression":undefined,"source":"lvOrderItems","targetProperty":"serviceVariableToTrack"}, {}]
}]
}],
layoutBox1: ["wm.Layout", {"horizontalAlign":"left","verticalAlign":"top"}, {}, {
panel1: ["wm.Panel", {"height":"100%","horizontalAlign":"left","verticalAlign":"top","width":"100%"}, {}, {
panel2: ["wm.Panel", {"height":"35px","horizontalAlign":"left","layoutKind":"left-to-right","verticalAlign":"top","width":"100%"}, {}, {
panel6: ["wm.Panel", {"height":"100%","horizontalAlign":"left","layoutKind":"left-to-right","verticalAlign":"top","width":"65%"}, {}, {
spacer4: ["wm.Spacer", {"height":"30px","width":"10px"}, {}],
label1: ["wm.Label", {"align":"center","caption":"Orders (Select to view Items)","height":"100%","padding":"4","styles":{"fontWeight":"bold"},"width":"100%"}, {}]
}],
panel7: ["wm.Panel", {"height":"100%","horizontalAlign":"left","layoutKind":"left-to-right","verticalAlign":"top","width":"30%"}, {}, {
spacer2: ["wm.Spacer", {"height":"48px","width":"10px"}, {}],
label2: ["wm.Label", {"align":"center","caption":"Orders Item Details","height":"100%","padding":"4","styles":{"fontWeight":"bold"},"width":"100%"}, {}]
}]
}],
panel3: ["wm.Panel", {"height":"100%","horizontalAlign":"left","layoutKind":"left-to-right","verticalAlign":"top","width":"100%"}, {}, {
panel4: ["wm.Panel", {"autoScroll":true,"height":"100%","horizontalAlign":"left","layoutKind":"left-to-right","verticalAlign":"top","width":"65%"}, {}, {
spacer3: ["wm.Spacer", {"height":"48px","width":"10px"}, {}],
listVendorOrders: ["wm.List", {"_classes":{"domNode":["MobileListStyle"]},"border":"1","columns":[{"show":true,"field":"orderId","title":"Order#","width":"200px","align":"left","formatFunc":"listVendorOrdersOrderIdFormat","editorProps":{"restrictValues":true},"mobileColumn":false},{"show":true,"field":"customerName","title":"CustomerName","width":"100%","align":"left","formatFunc":"listVendorOrdersCustomerNameFormat","editorProps":{"restrictValues":true},"mobileColumn":false},{"show":true,"field":"status","title":"Status","width":"120px","align":"left","formatFunc":"listVendorOrdersStatusFormat","editorProps":{"restrictValues":true},"expression":"\"<div class='MobileRow'><b>TotalPrice: <b>\" +${totalPrice}+ \"</div>\"","mobileColumn":false},{"show":false,"field":"address","title":"Address","width":"100%","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"contactNum","title":"ContactNum","width":"80px","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"PHONE COLUMN","title":"-","width":"100%","align":"left","editorProps":{"restrictValues":true},"expression":"\"<div class='MobileRowTitle'>Order#: \" + ${orderId} + \"</div>\"\n+ \"<div class='MobileRow'>CustomerName: \" + ${customerName} + \"</div>\"\n+ \"<div class='MobileRow'>Price: \" + ${price} + \"</div>\"\n","mobileColumn":false},{"show":false,"field":"orderDt","title":"OrderDt","width":"80px","align":"left","formatFunc":"wm_date_formatter","mobileColumn":false},{"show":false,"field":"vendorName","title":"VendorName","width":"100%","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"blockName","title":"BlockName","width":"100%","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"doorName","title":"DoorName","width":"100%","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"vendorId","title":"VendorId","width":"100%","align":"left","formatFunc":"","mobileColumn":false},{"show":true,"field":"price","title":"Price","width":"80px","align":"left","formatFunc":"listVendorOrdersPriceFormat","editorProps":{"restrictValues":true},"mobileColumn":false},{"show":false,"field":"customerId","title":"CustomerId","width":"100%","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"comment","title":"Comment","width":"100%","align":"left","formatFunc":"","mobileColumn":false},{"show":true,"controller":"rightarrow","width":"20px","title":"-","field":"_rightArrow","mobileColumn":true}],"headerVisible":false,"height":"100%","margin":"1","minDesktopHeight":60,"rightNavArrow":true,"styleAsGrid":false}, {"onSelect":"lvOrderItems","onSelect1":"listVendorOrdersSelect1"}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"svVendorCurrentOrders","targetProperty":"dataSet"}, {}]
}]
}]
}],
panel5: ["wm.Panel", {"autoScroll":true,"height":"100%","horizontalAlign":"left","layoutKind":"left-to-right","verticalAlign":"top","width":"35%"}, {}, {
spacer1: ["wm.Spacer", {"height":"48px","width":"10px"}, {}],
panel8: ["wm.Panel", {"height":"100%","horizontalAlign":"left","verticalAlign":"top","width":"100%"}, {}, {
panel9: ["wm.Panel", {"height":"30px","horizontalAlign":"left","layoutKind":"left-to-right","verticalAlign":"top","width":"100%"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"listVendorOrders.emptySelection","targetProperty":"disabled"}, {}]
}],
selectMenu1: ["wm.SelectMenu", {"caption":"selectMenu1","captionSize":"0px","dataField":"dataValue","dataType":"StringData","dataValue":undefined,"desktopHeight":"30px","displayField":"dataValue","displayValue":"","height":"30px","placeHolder":"Select status","width":"200px"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"app.vOrderStatus","targetProperty":"dataSet"}, {}]
}]
}],
button2: ["wm.Button", {"caption":"Update Status","height":"100%","iconMargin":"0 2px 0 0","margin":"4","width":"120px"}, {"onclick":"svUpdateOrderStatus","onclick1":"button2Click1"}]
}],
list2: ["wm.List", {"_classes":{"domNode":["MobileListStyle"]},"border":"1","columns":[{"show":true,"field":"orderItemId","title":"OrderItemId","width":"100%","align":"left","formatFunc":"list2OrderItemIdFormat","editorProps":{"restrictValues":true},"expression":"\n\n","mobileColumn":false},{"show":false,"field":"quantity","title":"Quantity","width":"80px","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"price","title":"Price","width":"80px","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"comments","title":"Comments","width":"100%","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"items.itemId","title":"Items.itemId","width":"80px","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"items.itemName","title":"Items.itemName","width":"100%","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"items.itemDesc","title":"Items.itemDesc","width":"100%","align":"left","formatFunc":"","mobileColumn":false},{"show":false,"field":"PHONE COLUMN","title":"-","width":"100%","align":"left","expression":"","mobileColumn":false}],"headerVisible":false,"height":"100%","margin":"1","minDesktopHeight":60,"styleAsGrid":false,"width":"80%"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"lvOrderItems","targetProperty":"dataSet"}, {}],
wire1: ["wm.Wire", {"expression":undefined,"source":"list1.emptySelection","targetProperty":"disabled"}, {}]
}]
}]
}]
}]
}]
}]
}]
};

DVendorOrderCurrentPg.prototype._cssText = '';
DVendorOrderCurrentPg.prototype._htmlText = '';